/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "ciclo")
@NamedQueries({
    @NamedQuery(name = "Ciclo.findAll", query = "SELECT c FROM Ciclo c"),
    @NamedQuery(name = "Ciclo.findByNCicId", query = "SELECT c FROM Ciclo c WHERE c.nCicId = :nCicId"),
    @NamedQuery(name = "Ciclo.findByVNombre", query = "SELECT c FROM Ciclo c WHERE c.vNombre = :vNombre"),
    @NamedQuery(name = "Ciclo.findByDtFchIni", query = "SELECT c FROM Ciclo c WHERE c.dtFchIni = :dtFchIni"),
    @NamedQuery(name = "Ciclo.findByDtFchFin", query = "SELECT c FROM Ciclo c WHERE c.dtFchFin = :dtFchFin"),
    @NamedQuery(name = "Ciclo.findByVEstado", query = "SELECT c FROM Ciclo c WHERE c.vEstado = :vEstado")})
public class Ciclo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nCicId")
    private Integer nCicId;
    @Column(name = "vNombre")
    private String vNombre;
    @Column(name = "dtFchIni")
    @Temporal(TemporalType.DATE)
    private Date dtFchIni;
    @Column(name = "dtFchFin")
    @Temporal(TemporalType.DATE)
    private Date dtFchFin;
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nCicId")
    private List<Docentexclase> docentexclaseList;
    @JoinColumn(name = "nFctId", referencedColumnName = "nFctId")
    @ManyToOne(optional = false)
    private Facultad nFctId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nCicId")
    private List<Horario> horarioList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciclo")
    private List<Docentexciclo> docentexcicloList;

    public Ciclo() {
    }

    public Ciclo(Integer nCicId) {
        this.nCicId = nCicId;
    }

    public Integer getNCicId() {
        return nCicId;
    }

    public void setNCicId(Integer nCicId) {
        this.nCicId = nCicId;
    }

    public String getVNombre() {
        return vNombre;
    }

    public void setVNombre(String vNombre) {
        this.vNombre = vNombre;
    }

    public Date getDtFchIni() {
        return dtFchIni;
    }

    public void setDtFchIni(Date dtFchIni) {
        this.dtFchIni = dtFchIni;
    }

    public Date getDtFchFin() {
        return dtFchFin;
    }

    public void setDtFchFin(Date dtFchFin) {
        this.dtFchFin = dtFchFin;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Docentexclase> getDocentexclaseList() {
        return docentexclaseList;
    }

    public void setDocentexclaseList(List<Docentexclase> docentexclaseList) {
        this.docentexclaseList = docentexclaseList;
    }

    public Facultad getNFctId() {
        return nFctId;
    }

    public void setNFctId(Facultad nFctId) {
        this.nFctId = nFctId;
    }
    
    public List<Horario> getHorarioList() {
        return horarioList;
    }

    public void setHorarioList(List<Horario> horarioList) {
        this.horarioList = horarioList;
    }

    public List<Docentexciclo> getDocentexcicloList() {
        return docentexcicloList;
    }

    public void setDocentexcicloList(List<Docentexciclo> docentexcicloList) {
        this.docentexcicloList = docentexcicloList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nCicId != null ? nCicId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ciclo)) {
            return false;
        }
        Ciclo other = (Ciclo) object;
        if ((this.nCicId == null && other.nCicId != null) || (this.nCicId != null && !this.nCicId.equals(other.nCicId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Ciclo[ nCicId=" + nCicId + " ]";
    }
    
}
